package cn.chencaiju.query;

import java.io.IOException;

import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TopDocs;

import cn.chencaiju.utils.LuceneUtils;

public class MyMatchAllQuery {
	public static void main(String[] args) throws IOException {
		// IndexSearcher
		IndexSearcher indexSearcher = LuceneUtils.getIndexSearcher();
		
		// 创建查询Query
		Query query = new MatchAllDocsQuery();
		
		TopDocs topDocs = indexSearcher.search(query, 100);
		
		LuceneUtils.printResult(indexSearcher, topDocs);
	}	
}
